<?php
// 应用公共文件
if (!function_exists('uuid')) {
    /**
     * 获取全球唯一标识
     * @return string
     */
    function uuid()
    {
        return sprintf(
            '%04x%04x-%04x-%04x-%04x-%04x%04x%04x', mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0x0fff) | 0x4000, mt_rand(0, 0x3fff) | 0x8000, mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff)
        );
    }
}



if (!function_exists('orderNo')) {

    function orderNo($hash,$c_code="SV") : string
    {
        //G0202112171344560001
        $order_no=$c_code.date("YmdHis").rand(1000,9999).substr($hash,-4);

        return $order_no;
    }

}